<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
<div id="app">
    <button @click="changMessage">修改message</button>
    <input type="text" name="" id="" v-model="message" v-on:keyup.enter="showMessage" >
    <h1>{{message}}</h1>

</div>
    <script src="./vue.js"></script>
<script>
    var app = new Vue({
        el:"#app",
        data:{
            message:'黑马'


        },
        methods:{
            showMessage:function(){
                alert(this.message)
            },
            changMessage:function(){
                this.message="asdf"
            }

            
        }
    })
   
    

</script>

</body>
</html>